package sample.ws.service;

import sample.ws.entity.ServiceAccessRuleEntity;
import sample.ws.entity.ServiceEntity;
import sample.ws.entity.ServiceIPRuleEntity;
import sample.ws.model.RuleModel;

import java.util.List;

/**
 * IService..
 *
 * @author Lizhong
 * @date 2019/7/15
 */
public interface IService {
    /**-------------服务操作------
     * @param serviceEntity*/
    boolean add(ServiceEntity serviceEntity);

    void update();

    void delete();

    ServiceEntity findServiceById(Long id);

    ServiceEntity findByName(String name);

    List<ServiceEntity> findServiceList(String category, Integer page, Integer size);


    boolean openServiceById(Long id);

    boolean closeServiceById(Long id);

    /**访问------------------控制*/
    boolean putIpBackListById(ServiceIPRuleEntity ipRuleEntity);

    boolean deleteIpBackListById(Long id);

    List<ServiceIPRuleEntity> getIpBackList();

    boolean putAccessRule(Long id, RuleModel rule);

    boolean deleteAccessRule(Long serviceId);

    List<ServiceAccessRuleEntity> getAccessRules();
}
